-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump up op-sqlite version for react native v0.76 #37
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR! I will review it when I'm back working on my mobile app |
Looks like the Error.stack getter issue has been resolved here: facebook/hermes#1496 (comment) But not landed in RN yet? |
Patching function createError(error, reason) {
var err = new PouchError(error.status, error.name, error.message);
if (reason !== undefined) {
err.reason = reason;
}
return err;
} |
Created a PR: pouchdb/pouchdb#9009 |
Sweet, thank you. Shall we wait for pouchdb to make changes, or should we patch it ourselves |
Let's wait for it to be merged. |
Sure, please proceed |
src/core.ts
Outdated
finish(null) | ||
}).catch(e => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert this 'catching all errors' part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this catch is important, since it rejects the promise of async execution. If removed, pouchdb.get() will remain unresolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean, it is for catching errors thrown from tx.execute
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, or tx.execute
will hang
hmm, trying to run it locally but it seems that Pods are broken:
will try generating a project with |
Have you tested replications? |
#37 (comment) I did not test replications, just local transactions. |
replications never finish. Maybe another breaking change in RN0.76 |
It could be another unresolved promise, i.e. an unhandled error in the promise, similar to the createError issue we encountered before. |
Yeah, I had to apply the patch to pouchdb-errors both in
|
#35
In React Native 0.76.3, createError from pouchdb-errors would throw an exception. To handle this, I catch all errors. However, this causes specific errors like MISSING_DOC to be converted into a more generic error:
Error.stack getter called with an invalid receiver.
You can see the related code here:
core.ts#L343